<script type="text/javascript">        

$(document).ready(function(){                                  

    $("#suppliers_select").change(function(){

        window.location.href = '<?=site_url('admin/suppliers/view/')?>/' + $(this).val();

    })  

});

</script>

<div id="content">       

    <? if(is_array($response)){?>
    <div class="response">
        <span class="<?=$response["class"]?>"><?=$response["msg"]?></span>
    </div>
    <?}?>


    <div class="float_block_right">
        Select a supplier: &nbsp;
        <select id="suppliers_select" class="float_right" style="min-width:150px">
        <? foreach($list as $supl){?>  
            <option value="<?=$supl["id_Supplier"]?>" <?if($supl["id_Supplier"]==$item["id_Supplier"]) print ' selected="selected"'?>><?=$supl["Name_Supplier"]?></option>
        <? } ?>
        </select>
        <a class="button" href="<?=site_url('admin/suppliers')?>" style="float:right; margin-left:5px">BACK TO LIST</a>
    </div>

    <h1><?=$item["Name_Supplier"]?></h1>

    <div style="width: 40%;" class="float_block">

        <div style="width: 100%;" class="float_block">                    
            <h4 style="float: left;">Supplier code</h4>                                    
            <div style="margin-left: 110px;" id="Code_Supplier"><?=$item["Code_Supplier"]?></div>     
        </div>  

        <div style="width: 100%;" class="float_block">                    
            <h4 style="float: left;">Contact Name</h4>                                    
            <div style="margin-left: 110px;" id="ContactName_Supplier"><?=$item["ContactName_Supplier"]?></div>     
        </div>

        <div style="width: 100%;" class="float_block">                    
            <h4 style="float: left;">Email</h4>                                    
            <div style="margin-left: 110px;" id="Email_Supplier"><?=$item["Email_Supplier"]?></div>     
        </div>

        <div style="width: 100%;" class="float_block">                    
            <h4 style="float: left;">Phone</h4>                                    
            <div style="margin-left: 110px;" id="Phone_Supplier"><?=$item["Phone_Supplier"]?></div>     
        </div>
    
        <div style="width: 100%;" class="float_block">                    
            <h4 style="float: left;">Fax</h4>                                    
            <div style="margin-left: 110px;" id="Fax_Supplier"><?=$item["Fax_Supplier"]?></div>     
        </div>             
    
        <div style="width: 100%;" class="float_block">                    
            <h4 style="float: left;">Mobile</h4>                                    
            <div style="margin-left: 110px;" id="Mobile_Supplier"><?=$item["Mobile_Supplier"]?></div>     
        </div>

        <div style="width: 100%;" class="float_block">                    
            <h4 style="float: left;">Website</h4>                                    
            <div style="margin-left: 110px;" id="WebSite_Supplier"><?=$item["WebSite_Supplier"]?></div>     
        </div>                    
    
    </div>


    <div style="width: 40%;" class="float_block">

        <div style="width: 100%;" class="float_block">                    
            <h4 style="float: left;">Address</h4>                                    
            <div style="margin-left: 110px;" id="Address_Supplier"><?=nl2br($item["Address_Supplier"])?></div>     
        </div>                 

        <div style="width: 100%;" class="float_block">                    
            <h4 style="float: left;">City</h4>                                    
            <div style="margin-left: 110px;" id="City_Supplier"><?=$item["City_Supplier"]?></div>     
        </div>                 

        <div style="width: 100%;" class="float_block">                    
            <h4 style="float: left;">State</h4>                                    
            <div style="margin-left: 110px;" id="State_Supplier"><?=$item["State_Supplier"]?></div>     
        </div>                 

        <div style="width: 100%;" class="float_block">                    
            <h4 style="float: left;">Post Code</h4>                                    
            <div style="margin-left: 110px;" id="PostCode_Supplier"><?=$item["PostCode_Supplier"]?></div>     
        </div>                 

        <div style="width: 100%;" class="float_block">                    
            <h4 style="float: left;">Country</h4>                                    
            <div style="margin-left: 110px;" id="Country_Supplier"><?=$item["Country_Supplier"]?></div>     
        </div>                 

        <div style="width: 100%;" class="float_block">                    
            <h4 style="float: left;">Address 2</h4>                                    
            <div style="margin-left: 110px;" id="Address2_Supplier"><?=nl2br($item["Address2_Supplier"])?></div>     
        </div>                 

    </div>

    <div class="content_block">
        <a class="button" id="edit_supplier_trigger" href="<?=site_url('admin/suppliers/edit/'.$item["id_Supplier"])?>">EDIT SUPPLIER INFO</a>
        <a class="button" href="<?=site_url('admin/suppliers/remove/'.$item["id_Supplier"])?>">DELETE SUPPLIER</a>
    </div>


    <?=modules::run("_admin/_suppliers/supplier_products", $item["id_Supplier"])?>

</div>